/* 
 * File:   test.cpp
 * Author: maxds
 *
 * Created on 31 juillet 2011, 15:46
 */

#include <cstdlib>
#include <cstdio>
#include "CompressorProcess.h"


using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {
    
    CompressorProcess cpr;
    
    cpr.initIPC();
    
    char c;
    scanf("%c",&c);
    //while(true){
        for(size_t i =0;i<100;i++)
        {
            alloc_event_t * event =cpr[i];

            switch (event->type){
                case 'm':
                    printf("malloc(%d)=%p;\n",event->size,event->ret);
                    break;
                case 'r':
                    printf("realloc(%p,%d)=%p;\n",event->addr_realloc,event->size,event->ret);
                    break;
                case 'c':
                    printf("calloc(%d;%d)=%p;\n",event->nmemb,event->size,event->ret);
                    break;
                case'f':
                    printf("free(%p);\n",event->ret);
                    break;
                default:
                    break;
            }
        }
    //}
    cpr.finitIPC();     
    return 0;
}

